# coding=utf-8

import unittest
from testcase import TestCalculator
from testsuite import Testsuite

if __name__ == '__main__':
    # 根据传入的测试类，获取类中所有以test开头的测试方法，并且返回一个测试套件
    loader = unittest.TestLoader()
    suite1 = loader.loadTestsFromTestCase(TestCalculator)
    suite2 = loader.loadTestsFromTestCase(Testsuite)

    # 将返回的测试套件加载到unittest的测试套件中
    suite = unittest.TestSuite([suite1, suite2])

    # 运行测试套年间中的用例
    runner = unittest.TextTestRunner(verbosity=2)
    runner.run(suite)
